package nl.tudelft.jpacman.board;

import nl.tudelft.jpacman.sprite.Sprite;

import java.util.List;
import java.awt.*;
public abstract class Unit {
    private Square square;

    public Unit() {
        // square 默认初始化为 null
    }

    public Square getSquare() {
        return square;
    }

    public void occupy(Square target) {
        if (target == null) {
            throw new NullPointerException("Target square must not be null.");
        }

        if (square != null) {
            square.remove(this);
        }

        square = target;
        target.put(this);
    }

    public abstract List<Sprite> getSprites();

    public abstract Sprite getSprite();

    public boolean hasSquare() {
        return false;
    }

    public void setDirection(Direction direction) {
    }

    public Square squaresAheadOf(int squaresAhead) {
        return null;
    }
}
